<?php
namespace app\msg\model;

use extra\Constant;
use think\Model;


class HtmlTemplate extends Model {
    
    public function template($content,$templateID){
        switch ($templateID) {
            case 1:
                return $this->template1($content);
                break;
            case 2:
                echo "i equals 1";
                break;
            case 3:
                echo "i equals 2";
                break;
        }
    }
    
    
    public function template1($content){
        $html='<!DOCTYPEHTML>
            <htmllang="en">
                <head>
                    <meta charset="utf-8" />
                    <meta name="format-detection" content="telephone=no, email=no"/>
                    <title></title>
                    <style type="text/css">
                    * {
                        margin: 0;
                        padding: 0;
                    }
                    p,
                    h1 {
                        margin: 10px 0;
                    }
                    h1 {
                        font-size: 16px;
                        border-bottom: 1px solid #eee;
                        padding-bottom: 10px;
                        padding-bottom: 10px;
                    }
                    p {
                        font-size: 12px;
                        line-height: 22px;
                    }
                    .center {
                        text-align: center;
                    }
                    .bold {
                        font-weight: 700;
                        font-size: 13px;
                    }
                    .color-red {
                        color: red;
                    }
                    span {
                        border-bottom: 1px solid #333;
                        padding: 0 10px;
                    }
                    .server,
                    .borrow {
                        overflow: hidden;
                        /*width: 100%;*/
                        height: auto;
                        margin: 0 5%;
                    }
                    </style>
                </head>
                <body>'
            .html_entity_decode($content, ENT_QUOTES, 'UTF-8').'
                </body>
            </html>';
        return $html;
    }
    
}


















